package com.xzy.mapper;

import com.xzy.custom.Page;
import com.xzy.entities.SysRole;
import com.xzy.entities.SysUser;
import com.xzy.web.form.SysUserForm;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * TODO
 *
 * @author XiangZhongyi
 * ClassName: 用户管理的映射器
 * date: 2021/9/20 20:17
 */
@Repository
public interface SysUserMapper {

    SysUser findByUserName(@Param("userName")String userName);

    SysUser save(SysUser user);

    void insertUserRole(@Param("form")SysUserForm form,@Param("role")SysRole role);

    Integer insert(@Param("form") SysUserForm form);

    Integer findAllUserInformationCount(@Param("page") Page page,@Param("name") String name);

    List<SysUser> findAllUserInformation(@Param("page") Page page,@Param("name") String name);

    SysUser findById(@Param("id")Integer id);

    void updateById(@Param("form") SysUserForm form);

    void insertUserRole1(@Param("form")SysUserForm form, @Param("rid")Integer rid);

    void insertUser(@Param("form") SysUserForm form);

    String findNumber();

    void updateUserRoleById(@Param("form")SysUserForm form, @Param("rid")Integer rid);

    void delUserInformation(@Param("parseInt") int parseInt);

    void delUserRole(@Param("parseInt")int parseInt);

    void updatePwdById(@Param("newpwd") String newpwd,@Param("id") Integer id);
}
